package com.dkcrow.transaction.anno.springconf;

import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Method;

import org.aopalliance.intercept.MethodInvocation;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.reflect.MethodSignature;

public class MyMethodInvocation implements MethodInvocation{
	
	ProceedingJoinPoint pjp;
	
	public MyMethodInvocation(ProceedingJoinPoint pjp) {
		this.pjp = pjp;
	}

	public static MyMethodInvocation newInstance(ProceedingJoinPoint pjp){
		return new MyMethodInvocation(pjp);
	}

	public Object[] getArguments() {
		return null;
	}

	public Object proceed() throws Throwable {
		return pjp.proceed();
	}

	public Object getThis() {
		return pjp.getThis();
	}

	public AccessibleObject getStaticPart() {
		return null;
	}

	public Method getMethod() {
		MethodSignature methodSignature = (MethodSignature) pjp.getSignature();
		return methodSignature.getMethod();
	}
}
